package main

import (
	"fmt"
	"time"
)

func main() {
	ch := make(chan int, 10)
	for i := 0; i < 10; i++ {
		ch <- i
	}
	go func() {
		//for v := range ch {
		//	fmt.Println(v)
		//}
		for {
			select {
			case vv, ok := <-ch:
				if ok {
					fmt.Println("ok=", ok)
					fmt.Println("vv=", vv)
				}

			}
		}
	}()
	close(ch)
	fmt.Println("main...")
	time.Sleep(time.Second * 5)
}
